<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class SchoolTeacherLeave extends Validate
{
    protected $rule = ['admin_id' => 'require|number','username' => 'require','leave_type' => 'require','day' => 'require|number','leave_info' => 'require','is_audit' => 'require|number',
    ];

    protected $message = ['admin_id.require' => '请假人为必填项','admin_id.number' => '请假人需为数字','username.require' => '姓名为必填项','leave_type.require' => '请假类型为必填项','day.require' => '天数为必填项','day.number' => '天数需为数字','leave_info.require' => '请假说明为必填项','is_audit.require' => '1=待审批,2=审批通过,3=审批未通过为必填项','is_audit.number' => '1=待审批,2=审批通过,3=审批未通过需为数字',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['admin_id','username','leave_type','day','leave_info','is_audit',]);
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['admin_id','username','leave_type','day','leave_info','is_audit',]);
    }
}
